#include "cuda-play/utils/time_cost.h"

namespace cuda_play {
namespace utils {
TimeCost::TimeCost() { start_ = std::chrono::system_clock::now(); }

uint64_t TimeCost::get_elapsed() {
  auto now = std::chrono::system_clock::now();
  uint64_t elasped =
      std::chrono::duration_cast<std::chrono::microseconds>(now - start_)
          .count();
  start_ = now;
  return elasped;
}
}  // namespace utils
}  // namespace cuda_play